<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="index.css">
  <title>Document</title>
</head>
<body>
  <nav role="navigation">
    <div id="menuToggle">

      <input type="checkbox" />

      <span></span>
      <span></span>
      <span></span>

      <ul id="menu">
        <a href="#">
          <li>Home</li>
        </a>
        <a href="#">
          <li>About</li>
        </a>
        <a href="#">
          <li>Info</li>
        </a>
        <a href="#">
          <li>Contact</li>
        </a>
        <a href="https://erikterwan.com/" target="_blank">
          <li>Show me more</li>
        </a>
      </ul>
    </div>
  </nav>
</body>
</html>
<script>
  // var num1 = 55
  // var num3 = 66
  // function fn(num, num1) {
  //   num = 100
  //   num1 = 100
  //   num2 = 100
  //   console.log(num, num1, num2);
  // }

  // fn(num1, num3)
  // console.log(num1, num2);
  // console.log(num);

  // function Person(name,age,salary) {
  //   this.name = name
  //   this.age = age
  //   this.salary = salary
  // }

  // function f1(person) {
  //   person.name = "ls"
  //   person = new Person("aa",18,10)
  // }

  // var p = new Person("zs",20,5)
  // console.log(p.name);
  // f1(p)
  // console.log(p.name);
  // 已知有一个字符串 foo = "get-element-by-id"，写一个function将其转化成驼峰表示法 "getElementById"

  var foo = "get-element-by-id"
  var arr = foo.split("-")
  function fn(string) {
    for (let i = 1; i < arr.length; i++) {
      arr[i] = arr[i][0].toUpperCase() + arr[i].substr(1, arr[i].length - 1)
    }
  }
  fn(foo)
  foo = arr.join("")
  console.log(foo);
</script>
